//
//  GKZYSortItemView.m
//  GKZYAid
//
//  Created by tony on 16/2/27.
//  Copyright © 2016年 GKZYAid. All rights reserved.
//


/**
 *  封装图标 UIImageView +UIlabel
 */

#import "GKZYSortItemView.h"
#import "MyDefine.h"

@implementation GKZYSortItemView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
       // self.backgroundColor = [UIColor redColor];
        [self addViews];
    }
    return self;
}


-(void)addViews{
    
    self.itemsImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, VIEWWIDTH, VIEWWIDTH)];
    self.itemsImageView.layer.cornerRadius = VIEWWIDTH / 2.0;
    [self addSubview:self.itemsImageView];
    
    self.itemsName = [[UILabel alloc]initWithFrame:CGRectMake(0, VIEWWIDTH *1.1, VIEWWIDTH , VIEWWIDTH/5)];
    self.itemsName.textAlignment = NSTextAlignmentCenter;
    [self addSubview:self.itemsName];
    self.itemsName.font = [UIFont systemFontOfSize:14];
    
}


-(void)setItemsImage:(UIImage *)image andItemsName:(NSString *)itemsName{

    self.itemsName.text = itemsName;
    self.itemsImageView.image = image;
    
}



@end
